package com.joysuch.wwyt.mh.controller;

import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.mh.service.MonitorPointDataToDBService;
import com.joysuch.wwyt.mh.service.WindVaneDataService;
import com.joysuch.wwyt.mh.storage.MonitorPointData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;

/**
 * @author zero
 * @since 2021/7/23 8:30
 */
@RestController
@RequestMapping("/mhMonitorPointAndType")
@Api("随机获取监测点数据")
public class MhMonitorPointAndTypeController {

    @Autowired
    private MonitorPointDataToDBService monitorPointDataToDBService;

    @Autowired
    private WindVaneDataService windVaneDataService;
    
    @ApiOperation("插入20条监测点数据")
    @RequestMapping("/addRadom")
    public ResultBean insertRadom(){
        List<MonitorPointData> monitorPointDataList = monitorPointDataToDBService.addStochastic();
        return ResultBean.success(monitorPointDataList);
    }

    @ApiOperation("模拟得到监测点数据")
    @RequestMapping("/getsimulationData/READ")
    public List<Map<String, Object>> insertStochastic(){
        return monitorPointDataToDBService.insertStochastic();
    }
    
    
    @ApiOperation("模拟得到风向标数据")
    @RequestMapping("/windVane/detail")
    public Object getSimulationData(String code){
        return windVaneDataService.simulationData(code);
    }

}
